home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 1 of 2).iso / utilities / u304.dms / in.adf / bits / remote-shell.AMOS / remote-shell.amosSourceCode < prev   
Encoding:
AMOS Source Code  |  1992-03-22  |  1.5 KB  |  72 lines

  1. ' Freely distrubutable << (I know its spelt wrong but im very hap-hazzard) 
  2. ' as long as NO profit is made from this proggy... 
  3. '
  4. ' A simulated REMOTE-SHELL using AMOS
  5. '
  6. ' Copyright  1991,  M. R. N. ARNOLD
  7. ' To contact me, 
  8. '    Write to 'Stephen Arnold' on either 071 for amiga or Cheam Amiga  
  9. '
  10. ' Please note that this program has been literally thrown together and it
  11. ' does not represent good programming practice at all!, But for something
  12. ' so short i dont really care.    Structure only becomes important on long 
  13. ' programs, However if you dont know how to structure programming then its 
  14. ' a good idea to try and do it, even on short ones, this proggy is a bodge!
  15. '
  16. ' Remote Shell Routine!
  17. '
  18. Reserve As Work 14,200
  19. Screen Open 0,640,200,2,Hires
  20. Paper 0 : Pen 1 : Cls : Colour 1,$CCC : ER=0
  21. Curs On 
  22. Global ER
  23. Request Off 
  24. Dir$="rad:"
  25. '
  26. '
  27. '
  28. For F=1 To 20 : Print : Next F
  29. BEGIN:
  30. On Error Goto 0
  31. Print 
  32. Line Input "1>";A$
  33. If A$="" Then Goto BEGIN
  34. A$=Upper$(A$)
  35. R=0
  36. If Mid$(A$,1,4)="RUN " Then R=1 : A$=Mid$(A$,5)
  37. A=1
  38. X1:
  39. If Mid$(A$,A,1)=" " Then Inc A : Goto X1
  40. A$=Mid$(A$,A)
  41. A=Instr(A$," ")
  42. X$=A$+" >pipe:DosXShell"
  43. If A<>0 Then X$=Mid$(A$,1,A)+">pipe:DosXShell "+Mid$(A$,(A+1))
  44. '
  45. If R=1 Then X$="RUN "+X$
  46. A=Start(14)
  47. For F=1 To Len(X$)
  48. Poke A,Asc(Mid$(X$,F,1))
  49. Inc A
  50. Next F
  51. Poke A,0
  52. Dreg(4)=Start(14)
  53. Call 15
  54. '
  55. Global ER
  56. Open In 1,"pipe:DosXShell"
  57. '
  58. On Error Proc X
  59. Do 
  60. XX:
  61. A$=Input$(1,1)
  62. If ER=1 Then Exit 
  63. If A$=Chr$(10) Then A$=Chr$(10)+Chr$(13)
  64. Print A$;
  65. Loop 
  66. Close 1
  67. ER=0
  68. Goto BEGIN
  69. Procedure X
  70. ER=1
  71. Resume Next 
  72. End Proc